home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / binutils.7 / binutils / binutils-2.7 / ld / configure.host < prev    next >
Encoding:
Text File  |  1996-07-04  |  8.9 KB  |  194 lines

  1. # This is the linker host specific file.  This is invoked by the
  2. # autoconf generated configure script.  Putting it in a separate shell
  3. # file lets us skip running autoconf when modifying host specific
  4. # information.
  5.  
  6. # This file sets the following shell variables:
  7. #  HDEFINES        host specific compiler flags
  8. #  HOSTING_CRT0        crt0.o file used for bootstrapping
  9. #  HOSTING_LIBS        libraries used for bootstrapping
  10. #  NATIVE_LIB_DIRS    library directories to search on this host
  11. #  HLDFLAGS        link flags to use on this host
  12. #  RPATH_ENVVAR        environment variable used to find shared libraries
  13.  
  14. HDEFINES=
  15. HOSTING_CRT0=/lib/crt0.o
  16. HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc'
  17. NATIVE_LIB_DIRS=
  18.  
  19. case "${host}" in
  20.  
  21. alpha-*-linux*)
  22.   HOSTING_CRT0=/usr/lib/crt0.o
  23.   ;;
  24.  
  25. alpha-*-*)
  26.   HOSTING_CRT0=/usr/ccs/lib/crt0.o
  27.   NATIVE_LIB_DIRS=/usr/ccs/lib
  28.   ;;
  29.  
  30. i[345]86-*-bsd* | i[345]86-*-freebsd* | i[345]86-*-netbsd*)
  31.   # The new BSD `make' has a bug: it doesn't pass empty arguments in
  32.   # shell commands.  So we need to make this value non-empty in order
  33.   # for the genscripts.sh call to work.  There's nothing magic about
  34.   # the value `/lib'; it's just a dummy.
  35.   NATIVE_LIB_DIRS=/lib
  36.   HOSTING_CRT0=/usr/lib/crt0.o
  37.   ;;
  38.  
  39. i[345]86-*-sysv4*)
  40.   HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  41.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o'
  42.   NATIVE_LIB_DIRS=/usr/ccs/lib
  43.   ;;
  44.  
  45. i[345]86-sequent-ptx* | i[345]86-sequent-sysv*)
  46.   HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  47.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi`'
  48.   ;;
  49.  
  50. i[345]86-*-sysv*)
  51.   HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
  52.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o'
  53.   ;;
  54.  
  55. i[345]86-*-solaris*)
  56.   HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else gcc -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else gcc -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  57.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else gcc -print-file-name=crtn.o; fi`'
  58.   NATIVE_LIB_DIRS=/usr/ccs/lib
  59.   ;;
  60.  
  61. i[345]86-*-sco* | i[345]86-*-isc*)
  62.   # In some configurations gcc does not use crtbegin.o and crtend.o.
  63.   # In that case gcc -print-file-name=crtbegin.o will simply print
  64.   # crtbegin.o.  We create dummy crtbegin.o and crtend.o files to
  65.   # handle this.
  66.   echo "int dummy_crtbegin () { return 0; }" > crtbegin.c
  67.   ${CC} -c crtbegin.c -o crtbegin.o
  68.   rm -f crtbegin.c
  69.   echo "int dummy_crteng () { return 0; }" > crtend.c
  70.   ${CC} -c crtend.c -o crtend.o
  71.   rm -f crtend.c
  72.   HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  73.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` /lib/crtn.o'
  74.   ;;
  75.  
  76. i[345]86-*-linuxaout* | i[345]86-*-linuxoldld)
  77.   HOSTING_CRT0=/usr/lib/crt0.o
  78.   ;;
  79.  
  80. i[345]86-*-linux*)
  81.   HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
  82.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
  83.   ;;
  84.  
  85. i[345]86-*-lynxos*)
  86.   HOSTING_CRT0=/lib/init1.o
  87.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
  88.   ;;
  89.  
  90. mips*-dec-bsd*)
  91.   HOSTING_CRT0=/usr/lib/crt0.o
  92.   ;;
  93.  
  94. mips*-sgi-irix4*)
  95.   HOSTING_CRT0=/usr/lib/crt1.o
  96.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
  97.   ;;
  98.  
  99. mips*-sgi-irix5*)
  100.   HOSTING_CRT0=/usr/lib/crt1.o
  101.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
  102.   ;;
  103.  
  104. m68*-*-linuxaout*)
  105.   HOSTING_CRT0=/usr/lib/crt0.o
  106.   ;;
  107.  
  108. m68*-*-linux*)
  109.   HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
  110.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
  111.   ;;
  112.  
  113. m68*-*-lynxos*)
  114.   HOSTING_CRT0=/lib/init1.o
  115.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
  116.   ;;
  117.  
  118. m68*-motorola-sysv)
  119.   HOSTING_CRT0='`if [ -f ../gcc/crt0.o ]; then echo ../gcc/crt0.o; elif [ -f \`gcc -print-file-name=\`crt0.o ]; then echo \`gcc -print-file-name=\`crt0.o; else echo /lib/crt0.o; fi`'
  120.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc881 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi`'
  121.   ;;
  122.  
  123. m68*-sun-*)
  124.   HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o'
  125.   ;;
  126.  
  127. m88*-*-dgux*)
  128.   HDEFINES=-D__using_DGUX
  129.   HOSTING_CRT0='/lib/crt0.o -X'
  130.   HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a
  131.   ;;
  132.  
  133. m88*-motorola-sysv3)
  134.   HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  135.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi`'
  136.   ;;
  137.  
  138. romp-*-*)
  139.   HDEFINES=-DNO_VARARGS
  140.   ;;
  141.  
  142. sparc*-*-solaris2*)
  143.   HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else gcc -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else gcc -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  144.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else gcc -print-file-name=crtn.o; fi`'
  145.   NATIVE_LIB_DIRS=/usr/ccs/lib
  146.   ;;
  147.  
  148. esac
  149.  
  150. HLDFLAGS=
  151. RPATH_ENVVAR=LD_LIBRARY_PATH
  152. # If we have shared libraries, try to set rpath reasonably.
  153. if test "${shared}" = "true"; then
  154.   case "${host}" in
  155.   *-*-hpux*)
  156.     HLDFLAGS='-Wl,+s,+b,$(libdir)'
  157.     RPATH_ENVVAR=SHLIB_PATH
  158.     ;;
  159.   *-*-irix5*)
  160.     HLDFLAGS='-Wl,-rpath,$(libdir)'
  161.     ;;
  162.   *-*-linux*aout*)
  163.     ;;
  164.   *-*-linux*)
  165.     HLDFLAGS='-Wl,-rpath,$(libdir)'
  166.     ;;
  167.   *-*-sysv4* | *-*-solaris*)
  168.     HLDFLAGS='-R $(libdir)'
  169.     ;;
  170.   esac
  171. fi
  172.  
  173. # On SunOS, if the linker supports the -rpath option, use it to
  174. # prevent ../bfd and ../opcodes from being included in the run time
  175. # search path.
  176. case "${host}" in
  177.   *-*-sunos*)
  178.     echo 'main () { }' > conftest.c
  179.     ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
  180.     if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
  181.       :
  182.     elif grep 'No such file' conftest.t >/dev/null 2>&1; then
  183.       :
  184.     elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
  185.       :
  186.     elif test "${shared}" = "true"; then
  187.       HLDFLAGS='-Wl,-rpath=$(libdir)'
  188.     else
  189.       HLDFLAGS='-Wl,-rpath='
  190.     fi
  191.     rm -f conftest.t conftest.c conftest
  192.     ;;
  193. esac
  194.